#include "mainwindow.h"
#include "linechartswidget.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainWindow w;

    //单屏幕
    QScreen* screen = QGuiApplication::primaryScreen();  //获取主屏幕
    // 获取屏幕大小, 设置创建尺寸
    QRect rect1 = screen->geometry();
    qDebug() << "rect1" << rect1.size().width() << rect1.size().height();
    qDebug() << rect1.topLeft();
    qDebug() << rect1.bottomRight();

    QRect rect2 = screen->availableGeometry();
    qDebug() << "rect2" << rect2.size().width() << rect2.size().height();
    qDebug() << rect2.topLeft();  // 左上角,
    qDebug() << rect2.bottomRight();  // 右下角,

    // w.setBaseSize(rect2.size().width(), rect2.size().height());

    // QSize sizeMax, sizeMin;
    // sizeMax.setWidth(rect2.size().width());
    // sizeMax.setHeight(rect2.size().height());
    // sizeMin.setWidth(rect2.size().width()/3);
    // sizeMin.setHeight(rect2.size().height()/3);
    // w.setMaximumSize(rect2.size().width(), rect2.size().height());
    // w.setMinimumSize(sizeMin);

    // w.setGeometry(0, 0, rect2.size().width() - 5, rect2.size().height() - 5);

    w.setMinimumSize(rect2.size().width()*2/5, rect2.size().height()*2/5);
    w.show();

    // LineChartsWidget *lineWidget = new LineChartsWidget();
    // lineWidget->show();

    return a.exec();
}
